import { IFeidaoAiNodejsComponent } from '@dfeidao/atom-nodejs/interfaces';
import nodejs from '@dfeidao/atom-nodejs/msg/nodejs';
import render from '@dfeidao/atom-nodejs/render/render';
import format from '@dfeidao/atom-web/dt/format';
import p001 from './p001';
export default async function na001(fd: IFeidaoAiNodejsComponent) {
	// todo
	const r = await nodejs<{ data: Array<{ record_no: string, plan_no: string, plan_name: string, record_location: string, inspection_time: string }>, n: Array<{ record_no: string, plan_no: string, plan_name: string, record_location: string, inspection_time: string }> }>(fd.data.actionid, fd.data.sessionid, 'imple-records/zj-000004/s001', {
		filter: {
			plan_name: '',
			starttime: '1970-01-01',
			endtime: '3000-01-01',
			pageno: 1
		}
	});
	// const d = res[0] as{}
	// console.log(r.data);
	// console.log(r.n.length);
	r.data.map((v) => {
		v.inspection_time = format(Number(v.inspection_time), 0);
	});
	render(fd.data.node, r, p001, 'p001');

}
